class Solution(object):
    def isNumber(self, s):
        """
        :type s: str
        :rtype: bool
        """
        count = 0
        identifier = [str(i) for i in range(10)]
        s = s.lower().split('e')
        if len(s) >= 3:
            return False
        first_e = s[0]
        first_e = first_e.split('.')
        if len(first_e) >= 3:
            return False
        inter = first_e[0]
        if not inter:
            count += 1
        else:
            if inter[0] in ['+', '-']:
                inter = inter[1:]
                if not inter:
                    count += 1
            for item in inter:
                if item not in identifier:
                    return False
        if len(first_e) == 2:
            f = first_e[1]
            if not f:
                count += 1
            else:
                for item in f:
                    if item not in identifier:
                        return False
        if count == len(first_e):
            return False
        if len(s) == 2:
            inter = s[1]
            if not inter:
                return False
            if inter[0] in ['+', '-']:
                if len(inter) == 1:
                    return False
                else:
                    inter = inter[1:]
                    if not inter:
                        return False
            for item in inter:
                if item not in identifier:
                    return False
        return True

data = Solution()
nums = ["abc", "1a", "1e", "e3", "99e2.5", "--6", "-+3", "95a54e53"]

for num in nums:
    print(data.isNumber(num))